// traceId
const CACHE_WEB_TRACE_ID= "webTraceId"
// 当前上报的页面标识 防止重复上报
const CACHE_LOG_PATH= "logPath"
// 有权限的资源状态（驾驶舱卡片）
const CACHE_RESOURCE_CARD_STYLES= "dashBoardResourceCardStyles"

export const WebTraceIdCache = {
    set: (webTraceIdJson) => {
        localStorage.setItem(CACHE_WEB_TRACE_ID, webTraceIdJson)
    },
    get: () => {
        return localStorage.getItem(CACHE_WEB_TRACE_ID)
    },
    remove: () => {
        localStorage.removeItem(CACHE_WEB_TRACE_ID)
    }
}
export const LogPathCache = {
    set: (logPathJson) => {
        localStorage.setItem(CACHE_LOG_PATH, logPathJson)
    },
    get: () => {
        return localStorage.getItem(CACHE_LOG_PATH)
    },
    remove: () => {
        localStorage.removeItem(CACHE_LOG_PATH)
    }
}
export const ResourceCardStylesCache = {
    set: (resourceCardStylesJson) => {
        localStorage.setItem(CACHE_RESOURCE_CARD_STYLES, JSON.stringify(resourceCardStylesJson))
    },
    get: () => {
        return JSON.parse(localStorage.getItem(CACHE_RESOURCE_CARD_STYLES))
    },
    remove: () => {
        localStorage.removeItem(CACHE_RESOURCE_CARD_STYLES)
    }
}
